package test;

import java.util.Scanner;

public class Mian1 {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String inputStr = s.nextLine();
        String[] strArray = inputStr.split(",");
        int[] num = new int[strArray.length];
        for(int i = 0 ; i < num.length ; i++){
            num[i] = Integer.parseInt(strArray[i]);
        }
        QuickSort(num,0,num.length-1);
        String str="";
        for (int i = 0; i < num.length; i++){
            str=str+num[i];
        }
        int result=Integer.parseInt(str);
        System.out.println(result);
    }

    //快速排序
    public static void QuickSort(int arr[],int _left,int _right){
        int right=_right;
        int left=_left;
        int temp=0;
        if(left<=right){
            temp=arr[left];
            while(left!=right){
                while(right>left&&Compare(arr[right],temp))
                    right--;
                arr[left]=arr[right];
                while(left<right&&Compare(temp,arr[left]))
                    left++;
                arr[right]=arr[left];
            }
            arr[right]=temp;
            QuickSort(arr,_left,left-1);
            QuickSort(arr,right+1,_right);
        }
    }

    //按新的排序规则重写比较方法
    public static boolean Compare(int a,int b){
        String s1=""+a;
        String s2=""+b;
        String s3=s1+s2;
        int k1=Integer.parseInt(s3);
        String s4=s2+s1;
        int k2=Integer.parseInt(s4);
        if(k1>=k2)
            return true;
        else
            return false;
    }
}
